﻿using System;
using System.Runtime.InteropServices;

namespace CH341PAR
{
	// Token: 0x0200000A RID: 10
	internal class CH341DLL
	{
		// Token: 0x0600005C RID: 92
		[DllImport("CH341DLL.DLL")]
		public static extern IntPtr CH341OpenDevice(uint iIndex);

		// Token: 0x0600005D RID: 93
		[DllImport("CH341DLL.DLL")]
		public static extern void CH341CloseDevice(uint iIndex);

		// Token: 0x0600005E RID: 94
		[DllImport("CH341DLL.DLL")]
		public static extern uint CH341GetVersion();

		// Token: 0x0600005F RID: 95
		[DllImport("CH341DLL.DLL")]
		public static extern uint CH341DriverCommand(uint iIndex, ref mWIN32_COMMAND_mBuffer ioCommand);

		// Token: 0x06000060 RID: 96
		[DllImport("CH341DLL.DLL")]
		public static extern uint CH341DriverCommand(uint iIndex, ref mWIN32_COMMAND_USB_SETUP_PKT ioCommand);

		// Token: 0x06000061 RID: 97
		[DllImport("CH341DLL.DLL")]
		public static extern uint CH341GetDrvVersion();

		// Token: 0x06000062 RID: 98
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341ResetDevice(uint iIndex);

		// Token: 0x06000063 RID: 99
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341GetDeviceDescr(uint iIndex, byte[] oBuffer, ref uint ioLength);

		// Token: 0x06000064 RID: 100
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341GetConfigDescr(uint iIndex, byte[] oBuffer, ref uint ioLength);

		// Token: 0x06000065 RID: 101
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetIntRoutine(uint iIndex, CH341DLL.mPCH341_INT_ROUTINE iIntRoutine);

		// Token: 0x06000066 RID: 102
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341ReadInter(uint iIndex, ref uint iStatus);

		// Token: 0x06000067 RID: 103
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341AbortInter(uint iIndex);

		// Token: 0x06000068 RID: 104
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetParaMode(uint iIndex, uint iMode);

		// Token: 0x06000069 RID: 105
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341InitParallel(uint iIndex, uint iMode);

		// Token: 0x0600006A RID: 106
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341ReadData0(uint iIndex, byte[] oBuffer, ref uint ioLength);

		// Token: 0x0600006B RID: 107
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341ReadData1(uint iIndex, byte[] oBuffer, ref uint ioLength);

		// Token: 0x0600006C RID: 108
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341AbortRead(uint iIndex);

		// Token: 0x0600006D RID: 109
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341WriteData0(uint iIndex, byte[] iBuffer, ref uint ioLength);

		// Token: 0x0600006E RID: 110
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341WriteData1(uint iIndex, byte[] iBuffer, ref uint ioLength);

		// Token: 0x0600006F RID: 111
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341AbortWrite(uint iIndex);

		// Token: 0x06000070 RID: 112
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341GetStatus(uint iIndex, ref uint iStatus);

		// Token: 0x06000071 RID: 113
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341ReadI2C(uint iIndex, byte iDevice, byte iAddr, ref byte oByte);

		// Token: 0x06000072 RID: 114
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341WriteI2C(uint iIndex, byte iDevice, byte iAddr, byte iByte);

		// Token: 0x06000073 RID: 115
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341EppReadData(uint iIndex, byte[] oBuffer, ref uint ioLength);

		// Token: 0x06000074 RID: 116
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341EppReadAddr(uint iIndex, byte[] oBuffer, ref uint ioLength);

		// Token: 0x06000075 RID: 117
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341EppWriteData(uint iIndex, byte[] iBuffer, ref uint ioLength);

		// Token: 0x06000076 RID: 118
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341EppWriteAddr(uint iIndex, byte[] iBuffer, ref uint ioLength);

		// Token: 0x06000077 RID: 119
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341EppSetAddr(uint iIndex, byte iAddr);

		// Token: 0x06000078 RID: 120
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341MemReadAddr0(uint iIndex, byte[] oBuffer, ref uint ioLength);

		// Token: 0x06000079 RID: 121
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341MemReadAddr1(uint iIndex, byte[] oBuffer, ref uint ioLength);

		// Token: 0x0600007A RID: 122
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341MemWriteAddr0(uint iIndex, byte[] iBuffer, ref uint ioLength);

		// Token: 0x0600007B RID: 123
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341MemWriteAddr1(uint iIndex, byte[] iBuffer, ref uint ioLength);

		// Token: 0x0600007C RID: 124
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetExclusive(uint iIndex, uint iExclusive);

		// Token: 0x0600007D RID: 125
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetTimeout(uint iIndex, uint iWriteTimeout, uint iReadTimeout);

		// Token: 0x0600007E RID: 126
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341ReadData(uint iIndex, byte[] oBuffer, ref uint ioLength);

		// Token: 0x0600007F RID: 127
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341WriteData(uint iIndex, byte[] iBuffer, ref uint ioLength);

		// Token: 0x06000080 RID: 128
		[DllImport("CH341DLL.DLL")]
		public static extern IntPtr CH341GetDeviceName(uint iIndex);

		// Token: 0x06000081 RID: 129
		[DllImport("CH341DLL.DLL")]
		public static extern uint CH341GetVerIC(uint iIndex);

		// Token: 0x06000082 RID: 130
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341FlushBuffer(uint iIndex);

		// Token: 0x06000083 RID: 131
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341WriteRead(uint iIndex, uint iWriteLength, byte[] iWriteBuffer, uint iReadStep, uint iReadTimes, ref uint oReadLength, byte[] oReadBuffer);

		// Token: 0x06000084 RID: 132
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetStream(uint iIndex, uint iMode);

		// Token: 0x06000085 RID: 133
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetDelaymS(uint iIndex, uint iDelay);

		// Token: 0x06000086 RID: 134
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341StreamI2C(uint iIndex, uint iWriteLength, byte[] iWriteBuffer, uint iReadLength, byte[] oReadBuffer);

		// Token: 0x06000087 RID: 135
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341ReadEEPROM(uint iIndex, CH341DLL.EEPROM_TYPE iEepromID, uint iAddr, uint iLength, byte[] oBuffer);

		// Token: 0x06000088 RID: 136
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341WriteEEPROM(uint iIndex, CH341DLL.EEPROM_TYPE iEepromID, uint iAddr, uint iLength, byte[] iBuffer);

		// Token: 0x06000089 RID: 137
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341GetInput(uint iIndex, ref uint iStatus);

		// Token: 0x0600008A RID: 138
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetOutput(uint iIndex, uint iEnable, uint iSetDirOut, uint iSetDataOut);

		// Token: 0x0600008B RID: 139
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341Set_D5_D0(uint iIndex, uint iSetDirOut, uint iSetDataOut);

		// Token: 0x0600008C RID: 140
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341StreamSPI3(uint iIndex, uint iChipSelect, uint iLength, byte[] ioBuffer);

		// Token: 0x0600008D RID: 141
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341StreamSPI4(uint iIndex, uint iChipSelect, uint iLength, byte[] ioBuffer);

		// Token: 0x0600008E RID: 142
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341StreamSPI5(uint iIndex, uint iChipSelect, uint iLength, byte[] ioBuffer, byte[] ioBuffer2);

		// Token: 0x0600008F RID: 143
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341BitStreamSPI(uint iIndex, uint iLength, byte[] ioBuffer);

		// Token: 0x06000090 RID: 144
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetBufUpload(uint iIndex, uint iEnableOrClear);

		// Token: 0x06000091 RID: 145
		[DllImport("CH341DLL.DLL")]
		public static extern int CH341QueryBufUpload(uint iIndex);

		// Token: 0x06000092 RID: 146
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetBufDownload(uint iIndex, uint iEnableOrClear);

		// Token: 0x06000093 RID: 147
		[DllImport("CH341DLL.DLL")]
		public static extern int CH341QueryBufDownload(uint iIndex);

		// Token: 0x06000094 RID: 148
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341ResetInter(uint iIndex);

		// Token: 0x06000095 RID: 149
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341ResetRead(uint iIndex);

		// Token: 0x06000096 RID: 150
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341ResetWrite(uint iIndex);

		// Token: 0x06000097 RID: 151
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetDeviceNotify(uint iIndex, string iDeviceID, CH341DLL.mPCH341_NOTIFY_ROUTINE iNotifyRoutine);

		// Token: 0x06000098 RID: 152
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetupSerial(uint iIndex, uint iParityMode, uint iBaudRate);

		// Token: 0x06000099 RID: 153
		[DllImport("CH341DLL.DLL")]
		public static extern IntPtr CH341OpenDeviceEx(uint iIndex);

		// Token: 0x0600009A RID: 154
		[DllImport("CH341DLL.DLL")]
		public static extern void CH341CloseDeviceEx(uint iIndex);

		// Token: 0x0600009B RID: 155
		[DllImport("CH341DLL.DLL", EntryPoint = "CCH341GetDeviceNameEx")]
		public static extern IntPtr CH341GetDeviceNameEx(uint iIndex);

		// Token: 0x0600009C RID: 156
		[DllImport("CH341DLL.DLL")]
		public static extern bool CH341SetDeviceNotifyEx(uint iIndex, string iDeviceID, CH341DLL.mPCH341_NOTIFY_ROUTINE iNotifyRoutine);

		// Token: 0x0400009A RID: 154
		public const int mCH341_PACKET_LENGTH = 32;

		// Token: 0x0400009B RID: 155
		public const int mCH341_PKT_LEN_SHORT = 8;

		// Token: 0x0400009C RID: 156
		public const int mCH341_MAX_NUMBER = 16;

		// Token: 0x0400009D RID: 157
		public const int mMAX_BUFFER_LENGTH = 4096;

		// Token: 0x0400009E RID: 158
		public const int mDEFAULT_BUFFER_LEN = 1024;

		// Token: 0x0400009F RID: 159
		public const int mCH341_ENDP_INTER_UP = 129;

		// Token: 0x040000A0 RID: 160
		public const int mCH341_ENDP_INTER_DOWN = 1;

		// Token: 0x040000A1 RID: 161
		public const int mCH341_ENDP_DATA_UP = 130;

		// Token: 0x040000A2 RID: 162
		public const int mCH341_ENDP_DATA_DOWN = 2;

		// Token: 0x040000A3 RID: 163
		public const int mPipeDeviceCtrl = 4;

		// Token: 0x040000A4 RID: 164
		public const int mPipeInterUp = 5;

		// Token: 0x040000A5 RID: 165
		public const int mPipeDataUp = 6;

		// Token: 0x040000A6 RID: 166
		public const int mPipeDataDown = 7;

		// Token: 0x040000A7 RID: 167
		public const int mFuncNoOperation = 0;

		// Token: 0x040000A8 RID: 168
		public const int mFuncGetVersion = 1;

		// Token: 0x040000A9 RID: 169
		public const int mFuncGetConfig = 2;

		// Token: 0x040000AA RID: 170
		public const int mFuncSetTimeout = 9;

		// Token: 0x040000AB RID: 171
		public const int mFuncSetExclusive = 11;

		// Token: 0x040000AC RID: 172
		public const int mFuncResetDevice = 12;

		// Token: 0x040000AD RID: 173
		public const int mFuncResetPipe = 13;

		// Token: 0x040000AE RID: 174
		public const int mFuncAbortPipe = 14;

		// Token: 0x040000AF RID: 175
		public const int mFuncSetParaMode = 15;

		// Token: 0x040000B0 RID: 176
		public const int mFuncReadData0 = 16;

		// Token: 0x040000B1 RID: 177
		public const int mFuncReadData1 = 17;

		// Token: 0x040000B2 RID: 178
		public const int mFuncWriteData0 = 18;

		// Token: 0x040000B3 RID: 179
		public const int mFuncWriteData1 = 19;

		// Token: 0x040000B4 RID: 180
		public const int mFuncWriteRead = 20;

		// Token: 0x040000B5 RID: 181
		public const int mFuncBufferMode = 32;

		// Token: 0x040000B6 RID: 182
		public const int FuncBufferModeDn = 33;

		// Token: 0x040000B7 RID: 183
		public const int mUSB_CLR_FEATURE = 1;

		// Token: 0x040000B8 RID: 184
		public const int mUSB_SET_FEATURE = 3;

		// Token: 0x040000B9 RID: 185
		public const int mUSB_GET_STATUS = 0;

		// Token: 0x040000BA RID: 186
		public const int mUSB_SET_ADDRESS = 5;

		// Token: 0x040000BB RID: 187
		public const int mUSB_GET_DESCR = 6;

		// Token: 0x040000BC RID: 188
		public const int mUSB_SET_DESCR = 7;

		// Token: 0x040000BD RID: 189
		public const int mUSB_GET_CONFIG = 8;

		// Token: 0x040000BE RID: 190
		public const int mUSB_SET_CONFIG = 9;

		// Token: 0x040000BF RID: 191
		public const int mUSB_GET_INTERF = 10;

		// Token: 0x040000C0 RID: 192
		public const int mUSB_SET_INTERF = 11;

		// Token: 0x040000C1 RID: 193
		public const int mUSB_SYNC_FRAME = 12;

		// Token: 0x040000C2 RID: 194
		public const int mCH341_VENDOR_READ = 192;

		// Token: 0x040000C3 RID: 195
		public const int mCH341_VENDOR_WRITE = 64;

		// Token: 0x040000C4 RID: 196
		public const int mCH341_PARA_INIT = 177;

		// Token: 0x040000C5 RID: 197
		public const int mCH341_I2C_STATUS = 82;

		// Token: 0x040000C6 RID: 198
		public const int mCH341_I2C_COMMAND = 83;

		// Token: 0x040000C7 RID: 199
		public const int mCH341_PARA_CMD_R0 = 172;

		// Token: 0x040000C8 RID: 200
		public const int mCH341_PARA_CMD_R1 = 173;

		// Token: 0x040000C9 RID: 201
		public const int mCH341_PARA_CMD_W0 = 166;

		// Token: 0x040000CA RID: 202
		public const int mCH341_PARA_CMD_W1 = 167;

		// Token: 0x040000CB RID: 203
		public const int mCH341_PARA_CMD_STS = 160;

		// Token: 0x040000CC RID: 204
		public const int mCH341A_CMD_SET_OUTPUT = 161;

		// Token: 0x040000CD RID: 205
		public const int mCH341A_CMD_IO_ADDR = 162;

		// Token: 0x040000CE RID: 206
		public const int mCH341A_CMD_PRINT_OUT = 163;

		// Token: 0x040000CF RID: 207
		public const int mCH341A_CMD_PWM_OUT = 164;

		// Token: 0x040000D0 RID: 208
		public const int mCH341A_CMD_SHORT_PKT = 165;

		// Token: 0x040000D1 RID: 209
		public const int mCH341A_CMD_SPI_STREAM = 168;

		// Token: 0x040000D2 RID: 210
		public const int mCH341A_CMD_I2C_STREAM = 170;

		// Token: 0x040000D3 RID: 211
		public const int mCH341A_CMD_UIO_STREAM = 171;

		// Token: 0x040000D4 RID: 212
		public const int mCH341A_CMD_PIO_STREAM = 174;

		// Token: 0x040000D5 RID: 213
		public const int mCH341A_BUF_CLEAR = 178;

		// Token: 0x040000D6 RID: 214
		public const int mCH341A_I2C_CMD_X = 84;

		// Token: 0x040000D7 RID: 215
		public const int mCH341A_DELAY_MS = 94;

		// Token: 0x040000D8 RID: 216
		public const int mCH341A_GET_VER = 95;

		// Token: 0x040000D9 RID: 217
		public const int mCH341_EPP_IO_MAX = 31;

		// Token: 0x040000DA RID: 218
		public const int mCH341A_EPP_IO_MAX = 255;

		// Token: 0x040000DB RID: 219
		public const int mCH341A_CMD_IO_ADDR_W = 0;

		// Token: 0x040000DC RID: 220
		public const int mCH341A_CMD_IO_ADDR_R = 128;

		// Token: 0x040000DD RID: 221
		public const int mCH341A_CMD_I2C_STM_STA = 116;

		// Token: 0x040000DE RID: 222
		public const int mCH341A_CMD_I2C_STM_STO = 117;

		// Token: 0x040000DF RID: 223
		public const int mCH341A_CMD_I2C_STM_OUT = 128;

		// Token: 0x040000E0 RID: 224
		public const int mCH341A_CMD_I2C_STM_IN = 192;

		// Token: 0x040000E1 RID: 225
		public const int mCH341A_CMD_I2C_STM_MAX = 32;

		// Token: 0x040000E2 RID: 226
		public const int mCH341A_CMD_I2C_STM_SET = 96;

		// Token: 0x040000E3 RID: 227
		public const int mCH341A_CMD_I2C_STM_US = 64;

		// Token: 0x040000E4 RID: 228
		public const int mCH341A_CMD_I2C_STM_MS = 80;

		// Token: 0x040000E5 RID: 229
		public const int mCH341A_CMD_I2C_STM_DLY = 15;

		// Token: 0x040000E6 RID: 230
		public const int mCH341A_CMD_I2C_STM_END = 0;

		// Token: 0x040000E7 RID: 231
		public const int mCH341A_CMD_UIO_STM_IN = 0;

		// Token: 0x040000E8 RID: 232
		public const int mCH341A_CMD_UIO_STM_DIR = 64;

		// Token: 0x040000E9 RID: 233
		public const int mCH341A_CMD_UIO_STM_OUT = 128;

		// Token: 0x040000EA RID: 234
		public const int mCH341A_CMD_UIO_STM_US = 192;

		// Token: 0x040000EB RID: 235
		public const int mCH341A_CMD_UIO_STM_END = 32;

		// Token: 0x040000EC RID: 236
		public const int mCH341_PARA_MODE_EPP = 0;

		// Token: 0x040000ED RID: 237
		public const int mCH341_PARA_MODE_EPP17 = 0;

		// Token: 0x040000EE RID: 238
		public const int mCH341_PARA_MODE_EPP19 = 1;

		// Token: 0x040000EF RID: 239
		public const int mCH341_PARA_MODE_MEM = 2;

		// Token: 0x040000F0 RID: 240
		public const int mCH341_PARA_MODE_ECP = 3;

		// Token: 0x040000F1 RID: 241
		public const int mStateBitERR = 256;

		// Token: 0x040000F2 RID: 242
		public const int mStateBitPEMP = 512;

		// Token: 0x040000F3 RID: 243
		public const int mStateBitINT = 1024;

		// Token: 0x040000F4 RID: 244
		public const int mStateBitSLCT = 2048;

		// Token: 0x040000F5 RID: 245
		public const int mStateBitWAIT = 8192;

		// Token: 0x040000F6 RID: 246
		public const int mStateBitDATAS = 16384;

		// Token: 0x040000F7 RID: 247
		public const int mStateBitADDRS = 32768;

		// Token: 0x040000F8 RID: 248
		public const int mStateBitRESET = 65536;

		// Token: 0x040000F9 RID: 249
		public const int mStateBitWRITE = 131072;

		// Token: 0x040000FA RID: 250
		public const int mStateBitSCL = 4194304;

		// Token: 0x040000FB RID: 251
		public const int mStateBitSDA = 8388608;

		// Token: 0x040000FC RID: 252
		public const int MAX_DEVICE_PATH_SIZE = 128;

		// Token: 0x040000FD RID: 253
		public const int MAX_DEVICE_ID_SIZE = 64;

		// Token: 0x040000FE RID: 254
		public const int IC_VER_CH341A = 32;

		// Token: 0x040000FF RID: 255
		public const int IC_VER_CH341A3 = 48;

		// Token: 0x04000100 RID: 256
		public const int CH341_DEVICE_ARRIVA = 3;

		// Token: 0x04000101 RID: 257
		public const int CH341_DEVICE_REMOVE_PEND = 1;

		// Token: 0x04000102 RID: 258
		public const int CH341_DEVICE_REMOVE = 0;

		// Token: 0x0200000C RID: 12
		// (Invoke) Token: 0x0600009F RID: 159
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		public delegate void mPCH341_INT_ROUTINE(uint iStatus);

		// Token: 0x0200000D RID: 13
		public enum EEPROM_TYPE
		{
			// Token: 0x04000113 RID: 275
			ID_24C01,
			// Token: 0x04000114 RID: 276
			ID_24C02,
			// Token: 0x04000115 RID: 277
			ID_24C04,
			// Token: 0x04000116 RID: 278
			ID_24C08,
			// Token: 0x04000117 RID: 279
			ID_24C16,
			// Token: 0x04000118 RID: 280
			ID_24C32,
			// Token: 0x04000119 RID: 281
			ID_24C64,
			// Token: 0x0400011A RID: 282
			ID_24C128,
			// Token: 0x0400011B RID: 283
			ID_24C256,
			// Token: 0x0400011C RID: 284
			ID_24C512,
			// Token: 0x0400011D RID: 285
			ID_24C1024,
			// Token: 0x0400011E RID: 286
			ID_24C2048,
			// Token: 0x0400011F RID: 287
			ID_24C4096
		}

		// Token: 0x0200000E RID: 14
		// (Invoke) Token: 0x060000A3 RID: 163
		[UnmanagedFunctionPointer(CallingConvention.StdCall)]
		public delegate void mPCH341_NOTIFY_ROUTINE(uint iEventStatus);
	}
}
